#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2019, Intel Corporation

#
# src/test/rpmem_obc/TEST1 -- unit test for rpmem_obc_connect
#
# This test checks negative connection attempts.
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type none
require_build_type nondebug debug

export RPMEM_CMD="echo -n ERROR!=="

setup

expect_normal_exit ./rpmem_obc$EXESUFFIX\
	client_connect\
	127.0.0.1\
	0.0.0.0\
	localhost\
	127.0.0.1:123\
	0.0.0.0:123\
	localhost:123\
	127.0.0.1:\
	127.0.0.1::123\
	127.0.0.1:-1\
	127.0.0.1:0\
	127.0.0.1:1\
	127.0.0.1:123\
	127.0.0.1:65535\
	127.0.0.1:65536\
	127.0.0.1:12345678\
	127.0.0.1:port\
	127.0.0.1:port123\
	127.0.0.1:123port\
	127.0.0.0.1\
	999.0.0.1\
	999.0.0.1:123

check

pass
